class_name Library_Event
extends Object

# 解释：这是是静态函数库的脚本，该脚本不需要加载，因为当通过类名访问静态函数时，已经进行隐性加载了
# 提示：函数名尽量使用小写和下划线

## 创建新的房间
static func new_create_room_event() -> Dictionary: 
	var event = {
		"EVENT_ID": Library_Tool.generate_random_string_upper(),
		"EVENT_CLASS":"CREATE_ROOM"
	}
	return event

## 加入新的房间
static func new_join_room_event(home_owner: String) -> Dictionary: 
	var event = {
		"EVENT_ID": Library_Tool.generate_random_string_upper(),
		"EVENT_CLASS":"JOIN_ROOM",
		"HOME_OWNER": home_owner
	}
	return event

## 向房间发送本信息
static func new_group_chat_event(home_owner: String,message: String) -> Dictionary: 
	var event = {
		"EVENT_ID": Library_Tool.generate_random_string_upper(),
		"EVENT_CLASS":"GROUP_CHAT",
		"HOME_OWNER":home_owner,
		"CHAT_MESSAGE":message
	}
	return event

## 退出房间
static func new_exit_room_event(home_owner: String) -> Dictionary: 
	var event = {
		"EVENT_ID": Library_Tool.generate_random_string_upper(),
		"EVENT_CLASS":"EXIT_ROOM",
		"HOME_OWNER":home_owner
	}
	return event

## 解散房间
static func new_close_room_event(home_owner: String) -> Dictionary: 
	var event = {
		"EVENT_ID": Library_Tool.generate_random_string_upper(),
		"EVENT_CLASS":"CLOSE_ROOM",
		"HOME_OWNER":home_owner
	}
	return event

## 房间心跳
static func new_room_heart_beat_event(home_owner: String) -> Dictionary: 
	var event = {
		"EVENT_ID": Library_Tool.generate_random_string_upper(),
		"EVENT_CLASS":"ROOM_HEART_BEAT",
		"HOME_OWNER":home_owner
	}
	return event
